<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- <meta http-equiv="X-UA-Compatible" name="renderer" content="text/html; charset=utf-8;IE=EmulateIE8" /> -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

<title>无纸化病案管理系统-登录</title>
<link rel="shortcut icon" href="<%=path%>/image/LOGO.png" type="image/x-icon">
<link rel="stylesheet" href="<%=path%>/css/login.css">
<script type="text/javascript" src="<%=path%>/script/jquery-easyui-1.4.5/jquery.min.js"></script>
<script type="text/javascript" src="<%=path%>/script/jquery-easyui-1.4.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path%>/script/jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery-easyui-1.4.5/jquery.easyui.extend.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/script/jquery-easyui-1.4.5/themes/bootstrap/easyui.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/script/jquery-easyui-1.4.5/themes/icon.css" />

<!-- 数字化验证中间件 -->
<script type="text/javascript"  src="<%=path%>/script/netca/NetcaPKI.js"></script>

</head>
<body>
 <div id="content" >
        <div class="contentTop" style="border:0px solid red;">
            <table  class="table" style="border:0px solid #e3e2e3;">
                <tr>
                  <td style="padding-left:20px;border-bottom:1px solid #e3e2e3;">
                      <div style="height:64px;line-height:64px;">
                   	 	 <img src="<%=path%>/image/login_logo.png">
                   	  </div>
                  </td>
                  <td style="height:90px;width:231px;">
				   	 <div class="contentTop_Right">
				   	    <span class="titleFont">无纸化病案管理系统</span>
				   	 </div>
				  </td> 
                </tr>
            </table>
        </div>

        <div class="contentMiddle" style="border: 0px solid blue;">
            <span class="titleFont"></span>
        </div>

        <div class="contentBottom" style="border: 0px solid red;">
           <table class="table">
               <tr>
                   <td> 
                        <!-- 对客户的资料进行保密，不需浏览器弹出记住密码, autocomplete="off" 来关闭记录   -->
                        <select id="certSelect" name="certSelect" class="easyui-combobox" data-options="iconCls:'icon-man',valueField:'value',textField:'label',width:330,height:30"></select>
	                 	<a class="easyui-linkbutton" onclick="return Cert_Refresh()" data-options="iconCls:'icon-mini-refresh',height:30"></a>
                   </td> 
               </tr> 
               
               <tr>
                   <td style="padding-top: 32px;"> 
                      <span id="passwordTSpan">
                 	     <input id="passwordT" class="easyui-textbox" data-options="events:{focus:pwdTfocus,keydown:pwdTkeydown},iconCls:'icon-lock',iconAlign:'left',prompt:'请输入密码',width:360,height:30"/>
                      </span>
                      <span id="passwordSpan" style="display:none">
                         <input id="password" type="password"  class="easyui-textbox" data-options="events:{focus:pwdfocus,blur:pwdblur},iconCls:'icon-lock',iconAlign:'left',width:360,height:30"/>
                      </span>
                      <!--  <input id="pwd" type="text"  value="请输入密码" style="color:#ccc"
	                 	    onfocus="if(this.value==defaultValue) {this.value='';this.type='password'}" onblur="if(!value) {value=defaultValue; this.type='text';}" /> -->
                   </td>                  
               </tr>
				 
			    <tr>
                   <td> 
                       <div class="subMsgBack" id="subMsgBack">
	                        <div id="upMsg" class="subMsg"><!-- 请输入正确的用户名/密码 --></div>
	                        <div id="dataMsg" class="subMsg"><!-- 用户名或密码不正确 --></div> 
                      </div>
                   </td> 
               </tr>
               <tr>
                   <td style="padding-top: 64px;">
                       <a href="javascript:submit();" id="submit" class="login_link">登&nbsp;&nbsp;录</a>
                   </td>
               </tr>
           </table>
        </div>
 </div>

  <div class="footer" style="display:none">
      <div class="footer_summary">安全<span class="spacing">&nbsp;</span>快捷<span class="spacing">&nbsp;</span>高效</div>
      <div class="footer_split_line"><span><img src="<%=path%>/image/white_line.png"/></span></div>
  </div>
 
  
<%-- <script type="text/javascript" src="<%=path%>/script/jquery-easyui-1.4.5/jquery.min.js"></script> --%>
<script type="text/javascript">
	var ticketSigned=null;
	var deviceSN=null;
	/** 
	  * 在页面中任何嵌套层次的窗口中获取顶层窗口 
	  * @return 当前页面的顶层窗口对象 
	  */
	if(window.document.URL.indexOf("manageLogin")==-1){
	  //location.href="manageLogin";
	}
	document.onkeydown=function(event){
		e = event ? event : (window.event ? window.event : null);
		if(e.keyCode==13){
			submit();  //调用登录按钮的登录事件
	    }
	} 
	
	function checkLoginName(){
		  document.getElementById("subMsgBack").style.display ="none";
	}   
	
	function pwdTfocus(){
		 document.getElementById("subMsgBack").style.display ="none";
	} 
	function pwdTkeydown(){
		document.getElementById("subMsgBack").style.display ="none"; 
	    document.getElementById("passwordTSpan").style.display ="none";
	    document.getElementById("passwordSpan").style.display ="block";
	    $('#password').next('span').find('input').focus(); 
	} 
	
	function pwdfocus(){
		 document.getElementById("subMsgBack").style.display ="none";
	} 
	function pwdblur(){
		 document.getElementById("subMsgBack").style.display ="none";  
		 if(this.value==""){
			  document.getElementById("passwordTSpan").style.display ="block";
			  document.getElementById("passwordSpan").style.display ="none"; 
		 } 
	} 

	 //方法二：IE8不通过
	/* $(function(){  
  		//document.getElementById("passwordSpan").style.display ="none";
  		//document.getElementById("password").style.display ="none";
  		//$("#password").next().hide(); 
  		//$("#password").next().css('display','none'); 
  		//$('#password').next(".textbox").hide(); 
  		
  		 $("input",$("#passwordT").next("span")).focus( function(){  
			   document.getElementById("subMsgBack").style.display ="none"; 
		 });
		 $("input",$("#passwordT").next("span")).keydown( function(){  
			   document.getElementById("subMsgBack").style.display ="none";
			   
			   document.getElementById("passwordTSpan").style.display ="none";
			   document.getElementById("passwordSpan").style.display ="block";
			   $('#password').next('span').find('input').focus();  
		  }); 
		 
		 $("input",$("#password").next("span")).focus( function(){ 
			   document.getElementById("subMsgBack").style.display ="none"; 
		 });
		 $("input",$("#password").next("span")).blur( function(){ 
			   document.getElementById("subMsgBack").style.display ="none";
			   
			   if(this.value==""){
				   document.getElementById("passwordTSpan").style.display ="block";
				   document.getElementById("passwordSpan").style.display ="none";
			      //$("#passwordT").next().show();
			      //$("#password").next().hide();
			   }        
		  });
		 
		 //方法三：IE8不通过
		   $("input",$("#password").next("span")).focus( function(){ 
			   document.getElementById("subMsgBack").style.display ="none";
			     $("#passwordT").next().show();
			     $("#password").next().show();
			     if(this.placeholder) { 
				   $("#password2").next().hide();
			     }    
		  });
		 
		 $("input",$("#password").next("span")).blur( function(){  
			   if(this.value=="请输入密码"){
				   this.value=this.defaultValue; this.type='text';
			   }  
		 }); 
	});*/
  	$(function(){
		Cert_Refresh();//刷新证书
  	});
	
	/**
	证书刷新
	*/
	function Cert_Refresh(){  
		//1.检测是否有UKEY插入
  		var bInsert=NetcaPKI.isKeyInserted();
  		if(!bInsert){
  			$.messager.alert('系统提示','没有检测到key插入!','info');
  			return;
  		}
  		//2.获取密钥信息
	    var certAarray= NetcaPKI.getCertsFromStore();//多密钥获取
		//默认有效和网证通的签名证书
		certAarray=certAarray.filter("InValidity='True'&& CheckPrivKey='True'&&CertType='Signature'");
		if(certAarray==null){
			$.messager.alert('系统提示','找不到证书!','info');
			return;
		}
		var data=[];
		for (var int = 0; int < certAarray.length; int++) {
			 var cert=certAarray[int];
			 data.push({label: cert.subjectCN+"("+cert.subjectOU+")",value: cert.serialNumber});
		}
		 $("#certSelect").combobox("loadData", data);
	}
	/**
	根据serialNumber获取证书
	*/
	function getCertificateFromSerialNumber(serialNumber){
	    var n = 1;
        var store = NetcaPKI._baseObject.CreateStoreObject();
        store.Open(NetcaPKI.CERT_STORE_TYPE_CURRENT_USER,NetcaPKI.CERT_STORE_NAME_DEVICE);
        
        var certCount = store.GetCertificateCount();    
        var cert;
        for(n = 1; n <= certCount; ++n){
            cert = store.GetCertificate(n);
           if(cert.SerialNumber==serialNumber){
        	   store.close();
               store=null;
               return cert;
           };
        }
	}
	/**
	验证密码
	*/
	function verifyPwd(){
		var serialNumber=$("#certSelect").combobox("getValue");
		var cert=getCertificateFromSerialNumber(serialNumber);
		if(cert==null){
			$.messager.alert('系统提示','找不到证书!','info');
			return -2;
		}
		var pwd=$("#password").val();
		var NETCAPKI_SEARCH_KEYPAIR_FLAG_CURRENT_USER=1073741824;
		var NETCAPKI_CERT_PURPOSE_SIGN=2;
		var device=cert.GetKeyPair(pwd,NETCAPKI_SEARCH_KEYPAIR_FLAG_CURRENT_USER,NETCAPKI_CERT_PURPOSE_SIGN).GetDevice();
		if(cert.verifyPwd(pwd)){
			ticketSigned=signedDataByCertificate(cert, "${ticket}", true, pwd);
		    if(ticketSigned==null){
				return -3;
		    }
		    deviceSN=device.SerialNumber;
			return -1;
		};
		return device.GetPwdRetryNumber();
	}
	
	function convertByte(sSource) {
	    return NetcaPKI.stringEncode(sSource);
	}
	
	/**3.4	使用指定证书,PKCS#7签名 **/
	function signedDataByCertificate(oCert, bContent, IsNotHasSource, pwd) {
	    if (bContent == "") {
	    	$.messager.alert('系统提示','原文内容为空!','info');
	        return null;
	    }
	    var signObj;
	    try {
	        signObj = NetcaPKI._baseObject.CreateSignedDataObject();
	    }
	    catch (e) {
	    	$.messager.alert('系统提示','安装不成功!','info');
	        return null;
	    }
	    var tbs;
	    if (typeof (bContent) == "string" || typeof (bContent) == "String") {
	        tbs = convertByte(bContent);
	    }
	    else {// 原文是数组
	        tbs = bContent;
	    }
	    if (signObj.SetSignCertificate(oCert, pwd, false) == false) {
	        $.messager.alert('系统提示','设置签名证书失败!','info');
	        return null;
	    }
	    signObj.SetSignAlgorithm(-1, getX509CertificateInfo(oCert, 8) == NETCAPKI_ALGORITHM_RSA.toString() ? NETCAPKI_ALGORITHM_RSASIGN : NETCAPKI_ALGORITHM_SM2SIGN);
	    signObj.SetIncludeCertificateOption(NETCAPKI_SIGNEDDATA_INCLUDE_CERT_OPTION);

	    // 1：不带原文；0：带原文
	    if (IsNotHasSource == 0 || IsNotHasSource == "0" || IsNotHasSource == false) {
	        // 带原文
	        signObj.Detached = false;
	    }
	    else {
	        signObj.Detached = true;
	    }
	    var str= signObj.Sign(tbs, NETCAPKI_CMS_ENCODE_BASE64);
	    signObj = null;
	    return str;
	}

	/***********2.7 获取证书信息: 根据证书 和  证书信息特定域类别 获取证书信息
	// 证书基本信息：
	 iValueType 具体信息参见常量定义 CERTVALUEPARSE
	* 输出：（字符串）返回证书信息
	*/
	function getX509CertificateInfo(oCert, iValueType) {
	    var rvStr;
	    var temp;
	    if (oCert == null) {
	        return null;
	    }
	    if (iValueType == null) {
	        return null;
	    }
	    switch (iValueType) {
	        case NETCAPKI_CERT_PEM:
	            try {
	                var certPem = oCert.Encode(2);
	                var certHeader = "-----BEGIN CERTIFICATE-----\r\n";
	                var certEnd = "-----END CERTIFICATE-----\r\n";
	                if (certPem.indexOf(certHeader) >= 0) {
	                    certPem = certPem.substring(certHeader.length, certPem.length);
	                    certPem = certPem.substring(0, certPem.length - certEnd.length);
	                }
	                return certPem;
	            }
	            catch (e) { return ""; }
	        case NETCAPKI_CERT_THUMBPRINT: //证书姆印
	            try {
	                return initialObj.BinaryToHex(oCert.ThumbPrint(NETCAPKI_ALGORITHM_SHA1), true);
	            }
	            catch (e) {
	                return "";
	            }
	        case NETCAPKI_CERT_SERIALNUMBER: //证书序列号
	            return oCert.SerialNumber;
	        case NETCAPKI_CERT_SUBJECT: //证书Subject
	            return oCert.Subject;
	        case NETCAPKI_CERT_ISSUER: // 证书颁发者
	            return oCert.Issuer;
	        case NETCAPKI_CERT_VALIDFROMDATE: //证书有效期起
	            var fromDate = new Date(oCert.ValidFromDate);
	            return fromDate.toString(); //2012-05-02 lu modify toDate.toDateString()
	        case NETCAPKI_CERT_VALIDTODATE: //证书有效期止
	            var toDate = new Date(oCert.ValidToDate);
	            return toDate.toString(); //2012-05-02 lu modify toDate.toDateString()
	        case NETCAPKI_CERT_KEYUSAGE: //密钥用法 KeyUsage
	            return "" + oCert.KeyUsage;
	        case NETCAPKI_CERT_PUBLICKEYALGO: //证书的公钥算法
	            return "" + oCert.PublicKeyAlgorithm;
	        case NETCAPKI_CERT_USRCERTNO: // UsrCertNO：证书绑定号；NETCA绑定姆印，编号为1；GDCA绑定为TrustID，编号为51；SZCA绑定为,编号为36;BJCA,编号为
	            if (getX509CertificateInfo(oCert, 21) == "NETCA") {
	                rvStr = "" + getX509CertificateInfo(oCert, 23); //取证书唯一标识
	                if (rvStr == "") {
	                    rvStr = "" + getX509CertificateInfo(oCert, 36); //取证书证件号码扩展域信息
	                    if (rvStr == "") {
	                        rvStr = "" + getX509CertificateInfo(oCert, 1); //取证书姆印
	                    }
	                }
	                return rvStr;
	            }
	            else if (getX509CertificateInfo(oCert, 21) == "2") {
	                return "" + getX509CertificateInfo(oCert, 51);
	            }
	            else {
	                return "未知CA";
	            }

	        case NETCAPKI_CERT_OLDUSRCERTNO:
	            if (getX509CertificateInfo(oCert, 21) == "NETCA") {
	                return getX509CertificateInfo(oCert, 31);
	            }
	            else {
	                return "";
	            }
	        case NETCAPKI_CERT_SUBJECT_NAME: // 证书主题名称；有CN项取CN项值；无CN项，取O的值； 
	            var tmp = getX509CertificateInfo(oCert, 12);
	            if (tmp == "") {
	                tmp = getX509CertificateInfo(oCert, 13);
	            }
	            return tmp;
	        case NETCAPKI_CERT_SUBJECT_CN: //Subject中的CN项（人名）
	            try {
	                return oCert.GetStringInfo(NETCAPKI_CERT_ATTRIBUTE_SUBJECT_CN);
	            }
	            catch (e) {
	                return "";
	            }

	        case NETCAPKI_CERT_SUBJECT_O: //Subject中的O项（单位)
	            try {
	                return oCert.GetStringInfo(NETCAPKI_CERT_ATTRIBUTE_SUBJECT_O);
	            }
	            catch (e) {
	                return "";
	            }

	        case NETCAPKI_CERT_SUBJECT_L: //Subject中的L项（地址）
	            try {
	                return oCert.GetStringInfo(NETCAPKI_CERT_ATTRIBUTE_SUBJECT_L);
	            }
	            catch (e) {
	                return "";
	            }

	        case NETCAPKI_CERT_SUBJECT_EMAIL: //Subject中的Email

	            try {
	                return oCert.GetStringInfo(NETCAPKI_CERT_ATTRIBUTE_SUBJECT_EMAIL);
	            }
	            catch (e) {
	                return "";
	            }

	        case NETCAPKI_CERT_SUBJECT_DEPARTMENT:  //Subject中的部门名
	            try {
	                return oCert.GetStringInfo(NETCAPKI_CERT_ATTRIBUTE_EX_DEPARTMENT);
	            }
	            catch (e) {
	                return "";
	            }

	        case NETCAPKI_CERT_SUBJECT_COUNTRY:   //用户国家名         
	            try {
	                return oCert.GetStringInfo(NETCAPKI_CERT_ATTRIBUTE_SUBJECT_C);
	            }
	            catch (e) {
	                return "";
	            }

	        case NETCAPKI_CERT_SUBJECT_CITY: //  用户省州名 
	            try {
	                return oCert.GetStringInfo(NETCAPKI_CERT_ATTRIBUTE_SUBJECT_ST);

	            }
	            catch (e) {
	                return "";
	            }

	        case NETCAPKI_CERT_CATITLE: // CAID  1：NETCA；2：GDCA；3：SZCA；0：未知CA
	            
	            for (var z= 0; z < NETCAPKI_SUPPORTCA.length; z++) {
	                if (getX509CertificateInfo(oCert, 4).indexOf(NETCAPKI_SUPPORTCA[z]) > 0) {
	                    return NETCAPKI_SUPPORTCA[z];
	                }
	            }
	            return "";
	        case NETCAPKI_CERT_CERTCLASSIFY: //CertID：证书类型
	            if (getX509CertificateInfo(oCert, NETCAPKI_CERT_CATITLE) == "NETCA") {
	                try {
	                    var netcaCaType = initialObj.DecodeASN1String(1, oCert.GetExtension("1.3.6.1.4.1.18760.1.12.12.2")); //netca证书类型扩展OID
	                    if (netcaCaType == "001") {
	                        return "3";
	                    }
	                    else if (netcaCaType == "002") {
	                        return "5";
	                    }
	                    else if (netcaCaType == "003") {
	                        return "4";
	                    }
	                    else if (netcaCaType == "004") {
	                        return "2";
	                    }
	                    return "0";
	                }
	                catch (e) {
	                    return "0";
	                }
	            }
	            else
	                return "0";
	        case NETCAPKI_CERT_CERTID: // 证书唯一标识
	            if (getX509CertificateInfo(oCert, NETCAPKI_CERT_CATITLE) == "NETCA") {
	                return "";
	            }
	            else {
	                return "";
	            }
	           
	          /*   证书唯一标识"GDCA"的条件，目前不采用
	           else if (getX509CertificateInfo(oCert, NETCAPKI_CERT_CATITLE) == "GDCA") {
	                return getX509CertificateInfo(oCert, 51);
	            }
	          */
	        case NETCAPKI_CERT_PREVCERT_THUMBPRINT:  // 旧姆印信息 
	            if (getX509CertificateInfo(oCert, NETCAPKI_CERT_CATITLE) == "NETCA")//NETCA 
	            {
	                try {
	                    return initialObj.BinaryToHex(oCert.GetStringInfo(NETCAPKI_CERT_ATTRIBUTE_PREVCERT_THUMBPRINT), true);
	                }
	                catch (e) {
	                    return "";
	                }
	            }
	            else {
	                return "";
	            }
	            break;
	        /* 需求没有提供 OID信息，无法获取，暂未实现
	        case NETCAPKI_CERT_TAXPAYERNUM: //纳税人编码（如保含该域，则取出，否则为“”）
	        break;
	        case NETCAPKI_CERT_ENTERPRISENUM:    //企业法人代码（如保含该域，则取出，否则为“”）
	        break;
	        case NETCAPKI_CERT_TAXREGISTERNUM:    //税务登记号（如保含该域，则取出，否则为“”）	
	        break;
	        case NETCAPKI_CERT_CERTFROM:    //证书来源地	
	        break;
	        */ 
	        case 36:
	            if (getX509CertificateInfo(oCert, NETCAPKI_CERT_CATITLE) == "NETCA")//NETCA 
	            {
	                try {
	                    return initialObj.DecodeASN1String(1, oCert.GetExtension(NETCAPKI_UUID));
	                }
	                catch (e) {
	                    return "";
	                }
	            }
	            else {
	                return "";
	            }
	            break;
	        case 37:
	            var rt = getX509CertificateInfo(oCert, 36);
	            if (rt.length > 13) {//00011@0006PO1MTIzNDU2Nzg5MDEyMzQ1Njc4
	                var beginIndex = rt.indexOf('@');
	                if (beginIndex == -1) {
	                    //alert("获取证件号码失败：无法定位@");
	                    return "";
	                }
	                var iClassify = rt.substring(beginIndex + 7, beginIndex + 8); //获取编码标志位
	                if (iClassify == "1") {
	                    var b64Identity = rt.substring(beginIndex + 8);
	                    var bIdentity = initialObj.Base64Decode(b64Identity);
	                    return initialObj.Decode(bIdentity, 65001);
	                }
	                else if (iClassify == "0") {
	                    return rt.substring(beginIndex + 8);
	                }
	                return "";
	            }
	            else {
	                return "";
	            }
	            break;
	        case NETCAPKI_CERT_TRUSTID:    //GDCA的信任号TrustID	
	            var oid = "1.2.86.21.1.3";
	            try {
	                if (getX509CertificateInfo(oCert, NETCAPKI_CERT_CATITLE) == "GDCA") {

	                    temp = initialObj.Decode(oCert.GetExtension(oid), NETCAPKI_CP);
	                    rvStr = temp.substr(2, temp.length - 2);
	                   
	                }
	                else {
	                    rvStr = "";
	                }
	            }
	            catch (e) {
	                rvStr = "";
	            }

	            break;
	        default:
	            return "";

	    }
	    return rvStr;
	}
	
	/**
	提交用户
	*/
	function submit() { 
		var serialNumber = $("#certSelect").combobox("getValue");
		var password = $("#password").val();
		var focusid = document.activeElement.id;
		if (serialNumber == null || serialNumber == "") {
			document.getElementById("subMsgBack").style.display ="block"; 
			$("#upMsg").text("用户不能为空！");
			return;
		}
		if (password == null || password == "") {
			$("#subMsgBack").css('display','block');
			$("#upMsg").text("密码不能为空！");
			$("#password").type="text"
			return;
		}
	    var pwdRetryNumber=verifyPwd();
	    if(pwdRetryNumber==-2){
	    	$("#subMsgBack").css('display','block');
			$("#upMsg").text("找不到证书！");
			return ;
	    }else if(pwdRetryNumber!=-1){
			$("#subMsgBack").css('display','block');
			$("#upMsg").text("UKEY密码错误，剩余密码重试次数："+pwdRetryNumber);
			return ;
		}else if(pwdRetryNumber == -3){
	    	$("#subMsgBack").css('display','block');
			$("#upMsg").text("设置签名证书失败!");
			return ;
		}
		$.ajax({
			url : "<%=path%>/logonCA",
			type : "post",
			data : {
				username : deviceSN,
				password : password,
				ticketSigned:ticketSigned
			},
			success : function(data) {
				if (data.success == true) {
					window.location.href = "<%=path%>" + data.url;
				} if(data.success == false) {
					$("#subMsgBack").css('display','block');
					$("#upMsg").text(data.msg);
				}
			}
		});
	};
	
    //正表达式-数字,字母和汉字验证 
	 function regUserName(str){ 
	 	//判断文本框不能输入特殊字符的正则表达式  能输入英文大小写字母、数字、中文 但不能输入特殊字符 
	 	var reg = /^([\u4e00-\u9fa5]+|[a-zA-Z0-9]+)$/; 
	 	if(str.match(reg) ==null){
	 		return false;
	 	}else{
	 		return true;
	 	}
	 }
</script>
</body>
</html>
